<template>
  <el-container class="common-layout">
    <el-header class="header-container">
      <div class="system-info">
        <div class="system-name">Xiong's CodeHorizon</div>
        <div class="system-subtitle">技术地平线，探索无限可能</div>
      </div>
      <el-dropdown>
        <el-avatar :size="36" :src="avatar" />
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <Menu />
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script setup>
import { ref, watch } from "vue";
import avatar from '@/assets/image/avatar2.png';
import Menu from "@/components/Menu/index.vue";

</script>
<style lang="scss" scoped>
.common-layout {
  height: 100vh;
  width: 100vw;

  .header-container {
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: #409EFF;
    color: white;

    .system-info {
      display: flex;
      flex-direction: column;
      align-items: flex-start;

      .system-name {
        font-size: 18px;
        font-weight: bold;
      }

      .system-subtitle {
        font-size: 12px;
        margin-top: 2px;
        color: rgba(255, 255, 255, 0.8);
      }
    }

    .el-dropdown {
      cursor: pointer;
    }
  }

  .el-aside {
    border-right: 1px solid #ccc;
    padding: 10px;
  }
  .el-main {
    padding: 10px;
  }

}
</style>
